package com.jobchecks.ping.api;


import com.jobchecks.common.baseresult.JobchecksResult;
import com.jobchecks.ping.api.request.TestReq;
import com.jobchecks.ping.api.response.TestResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.Size;

/**
 * 测试服务
 *
 * @author huangjinjia
 */
@Api(tags = "测试服务接口")
@RestController("/pingTest")
public interface TestPingService {

    /**
     * 新增接口
     *
     * @author huangjinjia
     */
    @ApiOperation("新增接口")
    @PostMapping("/add")
    JobchecksResult<TestResp> add(@ApiParam(value = "新增接口请求参数") @Valid @RequestBody TestReq req) ;

    /**
     * 更新接口
     *
     * @author huangjinjia
     */
    @ApiOperation("更新接口")
    @GetMapping("/update")
    String update(@ApiParam(value = "秘钥") @RequestParam @Size(min = 5, message = "秘钥最小值为5") String key,
                  @ApiParam(value = "配置") @RequestParam(required = false) String conf);


}
